package com.gec.mall.service.impl;

import com.gec.mall.document.EsItem;
import com.gec.mall.repository.EsItemRepository;
import com.gec.mall.service.EsItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

/**
 * @Author: li
 * @Date: 2023/2/15
 * @PACKAGE_NAME:com.gec.mall.service.impl
 * @Project_Name:mall-parent
 * @VERSION: 1.0.0
 */
@Service
public class EsItemServiceImpl implements EsItemService {

    @Autowired
    private EsItemRepository itemRepository;

    @Override
    public Page<EsItem> findByPrefix(String prefix, Pageable pageable) {
        return itemRepository.findByPrefix(prefix, pageable);
    }

    @Override
    public EsItem findById(Long id) {
        return itemRepository.findById(id).get();
    }
}
